package com.kma.summer2012.client.view.testStartPage;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Widget;
import com.kma.summer2012.client.presenters.test.TestPresenter;

/**
 * Created with IntelliJ IDEA.
 * User: EUGENE
 * Date: 2/14/13
 * Time: 11:20 AM
 * To change this template use File | Settings | File Templates.
 */
public class TestPage extends Composite implements TestPresenter.Display {

    interface TestPageUiBinder extends UiBinder<HTMLPanel, TestPage> {
    }


    @UiField
    protected Button login;
    @UiField
    protected Button manageWorks;
    @UiField
    protected Button manageTools;
    @UiField
    protected Button reject;
    @UiField
    protected Button viewMap;
    @UiField
    protected Button mainPage;
    @UiField
    protected Button closeRequest;
    @UiField
    protected Button createRequest;
    @UiField
    protected Button editRequestOperator;
    @UiField
    protected Button editRequestManager;
    @UiField
    protected Button showOperatorRequest;
    @UiField
    protected Button showEngineerRequest;


    private static TestPageUiBinder ourUiBinder = GWT.create(TestPageUiBinder.class);

    public TestPage() {
        HTMLPanel rootElement = ourUiBinder.createAndBindUi(this);
        this.initWidget(rootElement);
    }

    public HasClickHandlers getLogin() {
        return login;
    }

    public HasClickHandlers getManageWork() {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }


    public HasClickHandlers getManageWorks() {
        return manageWorks;
    }

    @Override
    public HasClickHandlers getManageTools() {
        return manageTools;
    }


    public HasClickHandlers getReject() {
        return reject;
    }

    public HasClickHandlers getCloseRequest() {
        return closeRequest;
    }

    public HasClickHandlers getViewMap() {
        return viewMap;
    }

    public HasClickHandlers getMainPage() {
        return mainPage;
    }

    @Override
    public HasClickHandlers getEditRequest() {
        return editRequestOperator;
    }

    @Override
    public HasClickHandlers getEditRequestManager() {
        return editRequestManager;
    }

    public HasClickHandlers getShowRequest() {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    public HasClickHandlers getShowRequestManager() {
        return null;  //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    public HasClickHandlers getShowRequestOperator() {
        return showOperatorRequest;  //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    public HasClickHandlers getShowEngineerRequest() {
        return showEngineerRequest;  //To change body of implemented methods use File | Settings | File Templates.
    }


    @Override
    public Widget asWidget() {
        return this;
    }

    @UiHandler("createRequest")
    protected void oncreateRequest(ClickEvent event) {
        History.newItem("createRequest");
    }

    /*  @UiHandler("editRequestOperator")
    protected void oneditRequestOperator(ClickEvent event) {
        History.newItem("editRequestOperator");
    }*/
    /*  @UiHandler("editRequestManager")
    protected void oneditRequestManager(ClickEvent event) {
        History.newItem("editRequestManager");
    }
    @UiHandler("showRequest")
    protected void onshowRequest(ClickEvent event) {
        History.newItem("showRequest");
    }

    ; */


}